<html>
<head>
	<meta charset="utf-8"/>
	<title>Operaciones</title>
	
</head>

<body>
	<label>Factorial de este número: <input type="number" id= "factorial-input" size="2">
	</label>
	<button id="factorial-button">Calcula</button>
	<br><br>

	<label>Calcula el logaritmo en 10 de: <input type="number" id="log-input" size="2">
	</label>
	<button id="logaritmo-button">Calcula</button>
	<br><br>

	<label>Calcula el seno de: <input type="number" id="angulo1-input" size="2">
	</label>
	<button id="seno-button">Calcula</button>
	<br><br>

	<label>Calcula el coseno de: <input type="number" id="angulo2-input" size="2">
	</label>
	<button id="coseno-button">Calcula</button>
	<br><br>

	<div id="solution">
	</div>

	<script type="text/javascript">
	
	function factorial()
	{
		var fac=document.getElementById('factorial-input').value;
		var v=1;
		for (var i=1; i<fac; i++){
			v=v*i;
		}
		document.getElementById('solution').innerHTML=('Factorial de ' + fac + ' = ' + v);
	}
	document.getElementById('factorial-button').addEventListener('click',factorial);
	
	function log ()
	{
		var loga=document.getElementById('log-input').value;
		res=Math.LOG10E*loga;
		document.getElementById('solution').innerHTML=('Logaritmo de ' + loga + '= ' + res);
	}
	document.getElementById('logaritmo-button').addEventListener('click',log);

	function seno()
	{
		var n=document.getElementById('angulo1-input').value;
		sen=Math.sin(n);
		document.getElementById('solution').innerHTML=('Seno de ' + n + '= ' + sen);
	}
	document.getElementById('seno-button').addEventListener('click', seno);

	function coseno ()
	{
		var n=document.getElementById('angulo2-input').value;
		cos=Math.cos(n);
		document.getElementById('solution').innerHTML=('Coseno de ' + n + '= ' + cos);
	}
	document.getElementById('coseno-button').addEventListener('click', coseno);

	</script>
</body>

</html>